#!/bin/bash
set -eo pipefail

#Directory that the script is in no matter where you invoke it from
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

export USE_ARBORIST_TEST_LISTENER=1

# Evergreen can issue a special command that retests everything in the entire repository. It signals this by providing
# a special branch name with prefix `evergreen_test_branch/everything`.
# We already have a mechanism to do this on our periodic mainline runs via setting of a special env variable which
# we piggyback on here. This resides in `CI.sh` for simplicity as it's an entry point to anything happening on CI and
# should be less error prone when it comes to setting environment variables than other approaches.
if [[ $JORB_GIT_BRANCH == evergreen_test_branch/everything* ]]; then
  export JORB_FORCE_ALL_PROJECTS_AS_DIRECLTY_AFFECTED=1
fi

"$DIR/gradlew" :ci:installDist --no-daemon -DSKIP_BUILD_SCAN=true 1>&2
"$DIR/ci/build/install/ci/bin/ci" "$@"

add 1 line
